#include "StdAfx.h"
#include "RealmHandler.h"

InitSingleton(RealmHandler);

void RealmHandler::addRealms(ByteBuffer& packet) {
	mLock.acquire();

	packet << uint16(mRealms.size());
	for(auto itr = mRealms.begin(); itr != mRealms.end(); ++itr) {
		Realm& rlm = itr->second;
		packet << rlm.icon << uint8(0) << rlm.type << rlm.name;
		packet << rlm.address << rlm.population << uint8(0);
		packet << rlm.timeZone << uint8(rlm.id);
	}

	mLock.release();
}